package com.hk.userservice.mapper;

import com.hk.model.WxRole;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: zhe
 * @Date: 2021/6/8 15:20
 * @Statement:  角色Mapper层接口
 */
public interface WxRoleMapper extends BaseMapper<WxRole> {


    @Override
    List<WxRole> findAll(WxRole wxRole);

    @Override
    int count(WxRole wxRole);

    @Select("select * from wx_role where id = #{id} ")
    @Override
    WxRole findById(Integer id);

    List<WxRole> findByIds(@Param("roleIds") List<Integer> roleIds);

    @Insert("insert into wx_role(name,description,gmt_create,state,sort)" +
            "   values (#{name},#{description},#{gmtCreate},#{state},#{sort})")
    @Override
    int save(WxRole wxRole);

    @Update("update wx_role set " +
            "   name=#{name},description=#{description},sort=#{sort} " +
            "   where id = #{id}")
    @Override
    int update(WxRole wxRole);

    @Delete("delete from wx_role where id = #{id} ")
    @Override
    int delete(Integer id);




}
